package main
import (
	"fmt"
	"maps"
)

func main(){

	s := make(map[string]int)

	s["alan"] = 1
	s["noc"] = 2
	fmt.Println("s:",s)

	alanNum := s["alan"]
	fmt.Println("alanNum:",alanNum)
	
	fmt.Println("Length of s:",len(s))

	delete(s,"noc")
	fmt.Println("Length of s:",len(s))

	clear(s)
	fmt.Println("Length of s:",len(s))

	// 【值，是否存在】
	_,prs := s["noc"]
	fmt.Println(prs)

	n := map[string]int {
		"alan":1,
		"noc":2,
		"ghost-him":3,
	}
	// 基于哈希表实现，所以内部存储是无序的
	fmt.Println("n:",n)

	n2 := map[string]int {
		"noc":2,
		"alan":1,
		"ghost-him":3,
	}

	if maps.Equal(n,n2){
		fmt.Println("n == n2")
	}
}